package com.example.listener;

import org.springframework.batch.core.annotation.AfterChunk;
import org.springframework.batch.core.annotation.BeforeChunk;
import org.springframework.batch.core.scope.context.ChunkContext;

/**
 * @author XieYa
 */
public class MyChunkListener {

    @BeforeChunk
    public void beforeChunk(ChunkContext chunkContext){
        System.err.println(chunkContext.getStepContext().getStepName()+"Chunk before...");
    }

    @AfterChunk
    public void afterChunk(ChunkContext chunkContext){
        System.err.println(chunkContext.getStepContext().getStepName()+"Chunk after...");
    }


}
